package com.yingside.collection.homework;

import java.util.*;

public class Test3 {
    public static void main(String[] args) {
        List<String> list = new LinkedList<>();
        Set<String> sets = new HashSet<>();
        String[] strs = {"12345","67891","12347809933","98765432102","67891","12347809933"};

        for (int i = 0; i < strs.length; i++) {
            sets.add(strs[i]);
        }

        list.addAll(sets);

        //增强for循环
        for (String s:list) {
            System.out.println("s = " + s);
        }

        //迭代器
        Iterator<String> iterator = list.iterator();
        while(iterator.hasNext()){
            String next = iterator.next();
            System.out.println("next = " + next);
        }
    }
}
